<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style>
</style>
</head>
<body>
<h1>国家列表</h1>

<table border="1">
	<tr><td>编码</td><td>名称</td><td>所属大洲</td></tr>
	<c:forEach items="${pageBean.list}" var="country">
		<tr><td>${country.code}</td>
		<td>${country.name}</td>
		<td>${country.continent}</td></tr>
	</c:forEach>
</table>


<!-- 第一页 -->
<c:choose>
	<c:when test="${pageBean.page>1}">
		<a href="country2?page=1">&lt;&lt;</a>
	</c:when>
	<c:otherwise>
		&lt;&lt;
	</c:otherwise>
</c:choose>


<!-- 前一页 -->
<c:choose>
	<c:when test="${pageBean.page>1}">
		<a href="country2?page=${pageBean.page-1}">&lt;</a>
	</c:when>
	<c:otherwise>
		&lt;
	</c:otherwise>
</c:choose>

<!--  中间页码 -->
<c:forEach begin="${pageBean.begin}" end="${pageBean.end}" step="1" varStatus="status">
	<c:choose>
		<c:when test="${pageBean.page!=status.current}">
			<a href="country2?page=${status.current}">${status.current}</a>
		</c:when>
		<c:otherwise>
			${status.current}
		</c:otherwise>
	</c:choose>
	
</c:forEach>

<!-- 后一页 -->
<a href="country2?page=${pageBean.page+1}">&gt;</a>

<!-- 最后一页 -->
<a href="country2?page=${pageBean.pageCount}">&gt;&gt;</a>

第${pageBean.page}页/总${pageBean.pageCount}

<form action="country2" style="display:inline">
	<input type="text" name="page" size="2"><input type="submit" value="go">
</form>
</body>
</html>